package com.ecarx.library_base.scoket.callback;

import java.util.Calendar;

public abstract class Packetlistener implements IListener<String> {
    public static final long DEFAULT_TIMEOUT = 16 * 1000;
    private long mCreateTime;
    private long mTimeOut;

    public Packetlistener(long timeOut) {
        this.mTimeOut = timeOut;
        long now = Calendar.getInstance().getTimeInMillis();
        mCreateTime = now;
    }

    public Packetlistener() {
        this.mTimeOut = DEFAULT_TIMEOUT;
        long now = Calendar.getInstance().getTimeInMillis();
        mCreateTime = now;
    }

    public long getCreateTime() {
        return mCreateTime;
    }

    public void setCreateTime(long createTime) {
        this.mCreateTime = createTime;
    }

    public long getTimeOut() {
        return mTimeOut;
    }

    public void setTimeOut(long timeOut) {
        this.mTimeOut = timeOut;
    }

    public abstract void onTimeout();
}
